package com.codemes.happylist.utils;

import cn.hutool.http.HttpRequest;

/**
 * @author nscoffee
 */
public class HttpHeaderUtil {


    public static HttpRequest setRequestHeader(HttpRequest request){
        return request.header("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9")
                .header("Accept-Encoding","gzip, deflate")
                .header("Accept-Language","zh,zh-CN;q=0.9,en-US;q=0.8,en;q=0.7")
                .header("Cache-Control","max-age=0")
                .header("Connection","keep-alive")
                .header("DNT","1")
                .header("Upgrade-Insecure-Requests","1")
                .header("User-Agent","Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.55 Safari/537.36");
    }

    public static HttpRequest setRequestSecHeader(HttpRequest request){
        request = setRequestHeader(request);
        return request.header("sec-ch-ua","\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"98\", \"Google Chrome\";v=\"98\"")
        .header("sec-ch-ua-mobile","?0")
        .header("sec-ch-ua-platform","\"Linux\"")
        .header("Sec-Fetch-Dest","document")
        .header("Sec-Fetch-Mode","navigate")
        .header("Sec-Fetch-Site","none")
        .header("Sec-Fetch-User","?1");
    }
}
